"""
    js 混淆 - 源码乱码赛
    题目1：抓取所有（5页）机票的价格，并计算所有机票价格的平均值，填入答案。
"""
import execjs
import requests


with open('1.js', 'r', encoding='utf-8') as fp:
    js_code = fp.read()
fun=execjs.compile(js_code)

headers = {
    'User-Agent': 'yuanrenxue.project'
}

url = f"https://match.yuanrenxue.cn/api/match/1"
params = {
    "m": fun.call('get_m')
}
response = requests.get(url, params=params, headers=headers)
print(response.text)

